#!/bin/bash
#by kun!

echo "==重启TOMCAT=="
#这里更改成tomcat的路径就可以了
tomcat_home="/opt/fps/tomcat-8080"
HUTDOWN=$tomcat_home/bin/shutdown.sh
STARTTOMCAT=$tomcat_home/bin/startup.sh
$SHUTDOWN
ps -ef |grep tomcat |grep $tomcat_home |grep -v 'grep'|awk '{print $2}' | xargs kill -9
echo "关闭tomcat 杀死进程成功。。。"
#删除tomcat的临时目录
rm  $tomcat_home/work/* -rf

sleep 3s
echo "休眠3秒 启动服务。。。"

$STARTTOMCAT
echo "启动成功-"
echo "查看日志命令 "
echo "==================="
echo "tail -f /opt/fps/tomcat-8080/logs/catalina.out"
echo "==================="
echo "复制运行！"